package anticheat;

public class CheatingOffenseEntry {

    private CheatingOffense offense;
    private int count = 0;
    private int characterid;
    private long lastOffense;
    private String param;
    private int dbid = -1;

    public CheatingOffenseEntry(CheatingOffense offense, int characterid) {
	super();
	this.offense = offense;
	this.characterid = characterid;
    }

    public CheatingOffense getOffense() {
	return offense;
    }

    public int getCount() {
	return count;
    }

    public int getChrfor() {
	return characterid;
    }

    public void incrementCount() {
	this.count++;
	lastOffense = System.currentTimeMillis();
    }

    public boolean isExpired() {
	if (lastOffense < (System.currentTimeMillis() - offense.getValidityDuration())) {
	    return true;
	}
	return false;
    }

    public int getPoints() {
	return count * offense.getPoints();
    }

    public String getParam() {
	return param;
    }

    public void setParam(String param) {
	this.param = param;
    }

    public long getLastOffenseTime() {
	return lastOffense;
    }

    public int getDbId() {
	return dbid;
    }

    public void setDbId(int dbid) {
	this.dbid = dbid;
    }
}
